/**
 *
 * @properties={typeid:24,uuid:"6946BB1F-424C-4F32-A3F9-E4CDCDC02A8F"}
 */
function Ira_resumen()
{
	globals.mostrarForm('resumen_relacion')
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"8A4351E7-54C7-47DB-90D5-00D99C2162B9"}
 */
function onAction_agregar_renglon(event) 
{
	var cual_relacion=elements.tabs_300.getTabRelationNameAt(elements.tabs_300.tabIndex);
	if (cual_relacion!='clientes_to_clientes')
	{
		if (cual_relacion!=null)
		{
			forms.clientes_abm[cual_relacion].newRecord(false);
		}
	}
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"0327D652-3A8C-478C-8D1D-A8487AD69272"}
 */
function onAction_eliminar_renglon(event) 
{
	var cual_relacion=elements.tabs_300.getTabRelationNameAt(elements.tabs_300.tabIndex);
	if(cual_relacion!='clientes_to_clientes')
	{
		if (cual_relacion!=null) 
			forms.clientes_abm[cual_relacion].deleteRecord();
	}

}

/**
 * Handle changed data.
 *
 * @param {Object} oldValue old value
 * @param {Object} newValue new value
 * @param {JSEvent} event the event that triggered the action
 *
 * @returns {Boolean}
 *
 * @properties={typeid:24,uuid:"C6311827-B02D-42F4-B237-1CC8A5BEC989"}
 */
function onDataChange_cuit(oldValue, newValue, event) 
{
	if (cuit != null)
	{
		if (tipo_identificacion == 99)
		{
			cuit = oldValue
			return true
		}
		if(tipo_identificacion == 80 && globals.verificar_cuit(cuit) == false)
		{
			cuit = oldValue
			return true;
		}
		else
			return true;	
	}
	return true
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"2EE4E31C-01DF-4A55-A054-F591DECEDAC1"}
 */
function iniciar(firstShow, event) 
{
	//tipo_iva_id=globals.zparam_cond_iva_default; // 28/07/2011
	//  27/01/2012
	globals.gsaldo_chq_propios=null;
	globals.gsaldo_chq_terceros=null;
	globals.gpedidos_no_remitidos=null;
	globals.gremitos_no_fact=null;
	globals.gsaldo_m1=null;
	globals.gsaldo_m4=null;
	globals.gtotal_riesgo=null;
	globals.gnumeral_recibo_vtas_1=null;
	globals.gnumeral_recibo_vtas_2=null;
	globals.gnumeral_recibo_vtas_3=null;
	globals.gfact_mas_antigua_adeudada=null;
	globals.gcoef_aceleracion_compra=null;
}

/**
 * Handle changed data.
 *
 * @param {Number} oldValue old value
 * @param {Number} newValue new value
 * @param {JSEvent} event the event that triggered the action
 *
 * @returns {Boolean}
 *
 * @properties={typeid:24,uuid:"8A04CFE0-A04E-4F15-862F-9B9612624F7B"}
 */
function onDataChangeTipoIdentificacion(oldValue, newValue, event) {
	if(newValue == 99)
	{
		cuit 		= '00000000000'
		tipo_iva_id = globals.zconf_tipo_iva_cons_final
	}
	return true
}

/**
 * Handle changed data.
 *
 * @param {Number} oldValue old value
 * @param {Number} newValue new value
 * @param {JSEvent} event the event that triggered the action
 *
 * @returns {Boolean}
 *
 * @properties={typeid:24,uuid:"B0DA10E2-E259-4B00-93DE-C9739462DC8F"}
 */
function onDataChangeIva(oldValue, newValue, event) {
	if (tipo_identificacion == 99)
	{
		tipo_iva_id = oldValue
	}
	return true
}
